package com.milkTeaServer.dao;

import com.milkTeaServer.bean.Comment;
import com.milkTeaServer.bean.Order;
import com.milkTeaServer.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderDao extends JpaRepository<Order,Integer> {
    @Modifying
    @Query(value="select id,userid, teaid, date,note,num from t_order where id = ?1 order by id desc",
            nativeQuery=true )
    List<Order> findOrderById(Integer id);
}
